package com.zhiche.wms.service.opbaas;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.wms.domain.model.otm.OtmOrderRelease;
import com.zhiche.wms.domain.model.otm.OtmShipment;
import com.zhiche.wms.dto.opbaas.paramdto.AppCommonQueryDTO;
import com.zhiche.wms.dto.opbaas.paramdto.OrderReleaseParamDTO;
import com.zhiche.wms.dto.opbaas.resultdto.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 运单 服务类
 * </p>
 *
 * @author user
 * @since 2018-05-24
 */
public interface IOrderReleaseService extends IService<OtmOrderRelease> {

    /**
     * 运单指令查询
     */
    Page<OrderReleaseParamDTO> queryOrderReleaseList(Page<OrderReleaseParamDTO> page);

    /**
     * 装车交验 - 查询列表
     */
    Page<ReleaseWithShipmentDTO> queryReleaseShipList(Page<ReleaseWithShipmentDTO> page);

    /**
     * 装车交验-详情获取
     */
    ReleaseWithShipmentDTO getReleaseShipDetail(AppCommonQueryDTO dto);

    /**
     * 装车交验确认
     */
    OtmOrderRelease updateReleaseShip(AppCommonQueryDTO dto);

    /**
     * 装车发运 - 模糊搜索查询
     */
    Page<ShipmentForShipDTO> queryShipList(Page<ShipmentForShipDTO> page);

    /**
     * 装车发运 -- 点击/扫码获取详情
     */
    ShipmentForShipDTO getShipDetail(AppCommonQueryDTO dto);

    /**
     * 装车发运 -- 确认发运
     */
    ShipmentForShipDTO updateShip(AppCommonQueryDTO dto);

    /**
     * 快速赋码--绑定车架号  回传OTM
     */
    void updateVin(AppCommonQueryDTO dto);

    /**
     * 查询车型信息
     */
    Page<VechielModelDTO> queryCarModelInfo (Page<VechielModelDTO> page);

    /**
     * 修改车型信息
     * @param conditions 修改条件
     */
    void updateVehicleInfo (AppCommonQueryDTO conditions);

    /**
     * 查询发运记录
     */
    Page<ShipmentRecordDTO> queryShipRecordList (Page<ShipmentRecordDTO> page);

    /**
     * 查询是否发运
     * @param tempList shipment表主键id
     */
    void isRepeatShipment (List<String> tempList);

    /**
     * 单车发运
     */
    List<String> releaseDespatch (Map<String, String> param);

    /**
     * 非正常订单之外的其他订单，例如：新渠道订单
     */
    Page<ShipmentRecordDTO> queryNewChannelReleaseList (Page<ShipmentRecordDTO> page);

    /**
     * 新渠道订单运单的单车发运（支持批量）
     */
    void despatchNewChannel (Map<String, String> param);

    /**
     * 取消发运
     * @param param
     * @param shipUser
     */
    void cancleShipment (String param, String shipUser);

    void updateReleaseInfo (ReleaseDTO releaseDTOs);

    void updateRelease (OtmOrderRelease otmOrderRelease);

    void pushInboundDispatch (OtmOrderRelease otmOrderRelease, OtmShipment otmShipmentRes, String shipDate);
}
